<?php

require_once 'lib/LzStopwatch.php';

$job    = new LzStopwatch(LzStopwatch::WAIT);

try { $job->end(); }
catch (LzBadUsage $e) { LzTests::ln('end() throw'); }

try { $job->length(); }
catch (LzBadUsage $e) { LzTests::ln('length() throw'); }

$job->begin();

usleep(100);
$mid    = $job->length();
LzTests::ln($mid > 0 ? '$mid > 0' : 'fail');

usleep(100);
$end    = $job->end();
LzTests::ln($end > $mid ? '$end > $mid' : 'fail');

LzTests::ln($job->length() == $end ? 'length() == $end' : 'fail');

?>
---EXPECT---
end() throw
length() throw
$mid > 0
$end > $mid
length() == $end

